//封装一个函数:获取一个结果:当前早上|上午|下午|晚上
export const getTime = () => {
  let message = "";
  //通过内置构造函数Date
  const hours = new Date().getHours();
  //情况的判断
  if (hours <= 9) {
    message = "早上";
  } else if (hours <= 12) {
    message = "上午";
  } else if (hours <= 18) {
    message = "下午";
  } else {
    message = "晚上";
  }
  return message;
};

export const getType = () => {
  let message = 0;
  //通过内置构造函数Date
  const hours = new Date().getHours();
  //情况的判断
  if (hours <= 10 && hours >= 6) {
    message = 0;
  } else if (hours <= 15) {
    message = 1;
  } else {
    message = 2;
  }
  console.log("index :", message);
  return message;
};
